<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Game</title>
        <link rel="stylesheet" href="../gameStyle.css" type="text/css" />
        <script src="../lib/Box2dWeb-2.1.a.3.js"></script>
        <script type="text/javascript" src="../lib/jquery-latest.js"></script>
        <script type="text/javascript" src="../lib/ivank.js"></script>
        <script src="types.js"></script>
        <!--
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript" src="http://lib.ivank.net/ivank.js"></script>
        -->
        <script type="text/javascript" src="types.js"></script>
        <script type="text/javascript" src="button.js"></script>
        <script type="text/javascript" src="timer.js"></script>
        <script type="text/javascript" src="level.js"></script>
        <script type="text/javascript" src="turtle.js"></script>
        <script type="text/javascript" src="commands.js"></script>
    </head>
    <body onload="Start();">

        <canvas id="canvas" width="740" height="500"></canvas>
        <script> 
            var canvas = document.getElementById("canvas");
            var cwidth = canvas.getAttribute("width");
            var cheight = canvas.getAttribute("height");
            
            var exampleTurtle =  new Turtle(cwidth/2 + 300, cheight/2 + 140);
            function Start(){
                var stage = new Stage("canvas");
                var level = new TurtleLevel();
                stage.addChild(level);
                
                drawExample();
                stage.addChild(exampleTurtle);
                exampleTurtle.draw();
                
                intervalID = window.setInterval(level.run, 1000 / 60);
            }
           
            function drawExample(){
                for(var i = 0;i < 3;i++){
                    triangle();
                    exampleTurtle.fd(150);
                    exampleTurtle.lt(120);
                }
                
                
                function triangle(){
                    for(var i = 0;i < 3;i++){
                        exampleTurtle.fd(50);
                        exampleTurtle.rt(120);
                    }
                }
            }
            
            
            
            
            
            
            
        </script>
        <script type="text/javascript" src="turtlelevel.js"></script>
        <script type="text/javascript" src="level.js"></script>

    </body>
</html>
